home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / DATABASE / DATAGE55 / DG.DOC < prev    next >
Text File  |  1989-02-15  |  53KB  |  1,976 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.                                 The DataGen Kit
  26.                              USER REFERENCE MANUAL
  27.  
  28.                            Version 2.02 January 1989
  29.                       (C) Copyright 1989 by Tika Software.
  30.                               All Rights Reserved
  31.  
  32.                                  Tika Software
  33.                                 112 Village Path
  34.                                Lakewood, NJ 08701
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59. ────────────────────────────────────────────────────────────────────────────────
  60.  
  61.                                    DISCLAIMER
  62.  
  63.      Tika Software makes no representation or warranties with respect to
  64.      the contents hereof and specifically disclaims any implied warranties
  65.      to the suitability of this program for any particular purpose. You
  66.      must determine that yourself. In addition, you should understand that
  67.      using a program of this type on an IBM PC or compatible has inherent
  68.      risks and that you may inadvertently damage or destroy valuable pro-
  69.      grams or data. Tika Software expressly declines to assume liability
  70.      for any use of this program by you, and your use of this program con-
  71.      stitutes your agreement to hold us blameless. Tika Software reserves
  72.      the right to make changes from time to time in the context hereof
  73.      without obligation to notify any person or persons of such changes.
  74.  
  75.                                    TRADEMARK
  76.  
  77.      MS-DOS is a registered trademark of Microsoft Corporation.
  78.      PC-DOS is a registered trademark of IBM Corporation.
  79.      Turbo Pascal and Turbo Database Toolbox are registered trademarks of
  80.      Borland, Intl.
  81.      BTRIEVE is a registered trademark of SoftCraft, Inc.
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119. ────────────────────────────────────────────────────────────────────────────────
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.                            DataGen Table of Contents
  128.  
  129.      Introduction.........................................................1
  130.      The DataGen Theory...................................................1
  131.      Why Use DataGen?.....................................................1
  132.      Mastering DataGen....................................................2
  133.      A Recipe for Instant DataGen Applications............................2
  134.      Explanation of Terms.................................................2
  135.  
  136.  
  137.      ScreenGen............................................................4
  138.      Command Syntax.......................................................4
  139.  
  140.      Overview.............................................................5
  141.           Syntax...............................................................5
  142.           Output...............................................................5
  143.  
  144.      Reference Guide......................................................7
  145.           File Specification...................................................7
  146.           Command Structure....................................................7
  147.           Screen Definition Section............................................7
  148.           Global Definition Section............................................8
  149.           Variable Definition Section.........................................13
  150.  
  151.      ScreenGen Sample Screens............................................15
  152.  
  153.  
  154.      DataGen.............................................................18
  155.      Overview............................................................19
  156.           Syntax..............................................................19
  157.           Output..............................................................19
  158.           Editing Turbo Source................................................20
  159.  
  160.      DataGen Reference...................................................21
  161.           File Specification..................................................21
  162.           Command Structure...................................................21
  163.  
  164.      Appendix A) Description of IO.TPU...................................23
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179. ────────────────────────────────────────────────────────────────────────────────
  180.  
  181.  
  182.      Introduction
  183.  
  184.      DataGen enables the Turbo Pascal programmer to generate single screen
  185.      -- single datafile database applications quickly, efficiently, and
  186.      with a minimum of programming expertise. Developed with the simple ap-
  187.      plication in mind, DataGen facilitates rapid creation of such programs
  188.      as mailing, client and sales lists.
  189.  
  190.  
  191.      The DataGen Theory
  192.  
  193.      Many database generation systems presume that the datafile is the cen-
  194.      tral component of the database application. While this is often the
  195.      case in relational databases which manipulate several files, it com-
  196.      plicates the process of creating simple list applications.
  197.  
  198.      DataGen follows the premise that the Data Entry Screen is the pivotal
  199.      component of a database application, effectively mirroring the struc-
  200.      ture of the datafile. From a simple ascii screen definition file,
  201.      DataGen creates a full-function database, storing the items of the
  202.      data entry screen as fields in the database.
  203.  
  204.  
  205.      Why Use DataGen?
  206.  
  207.      DataGen generates accurate and thoroughly documented Turbo Pascal
  208.      source code.
  209.  
  210.      Once compiled (using Turbo Pascal 4.0 or higher) DataGen applications
  211.      execute independent of runtime modules, and background processes.1
  212.  
  213.      DataGen generates databases in BTRIEVE or Turbo Toolbox format
  214.  
  215.      Under BTRIEVE, DataGen applications run on a variety of Multi-user
  216.      Network environments, with full file and record locking.
  217.  
  218.      Applications which are developed using DataGen are free from royalty
  219.      restrictions.
  220.  
  221.      The typical DataGen full-function database can be developed in under
  222.      10 minutes.
  223.  
  224.      DataGen is a Turbo Pascal programming tool; it places no limitations
  225.      on the final database application. The scope of the final process is
  226.      bounded only by the skill of the Turbo Pascal programmer.
  227.  
  228.      ScreenGen (part of the DataGen Development Kit) generates screens in-
  229.      dependent of DataGen, and may be used in the development of both data-
  230.      base and non-database applications.
  231.  
  232.      1BTRIEVE format databases require BTRIEVE to be loaded upon execution
  233.  
  234.  
  235.  
  236.  
  237.               DataWrite Page 1 -- Copyright (C) Tika Software, Co.
  238. ────────────────────────────────────────────────────────────────────────────────
  239.  
  240.  
  241.      Mastering DataGen
  242.  
  243.      The DataGen Development Kit is made up of two separate processes:
  244.  
  245.      ScreenGen:         Data Entry Screen generator
  246.      DataGen:           Database generator
  247.  
  248.      Programmers of DataGen should begin by familiarizing themselves with
  249.      ScreenGen's Screen Development Language (SDL). DataGen utilizes
  250.      ScreenGen SDL source files to build a data storage system for informa-
  251.      tion passed to and from the screen.
  252.  
  253.  
  254.  
  255.      A Recipe For Instant DataGen Applications
  256.  
  257.      Step 1: Design a screen. I suggest you thoroughly cover the ScreenGen
  258.      section of this manual, however if you're impatient, as I am, flip
  259.      back and forth between the ScreenGen Syntax section of the Reference
  260.      manual, and the ScreenGen Sample Screen section. Good luck.
  261.  
  262.      Step 2: Follow the instructions listed in the Syntax section of the
  263.      DataGen Overview.
  264.  
  265.      Step 3: Execute the application. There, instant gratification. Do you
  266.      feel good about yourself? No, you feel cheap and empty inside... I
  267.      suggest that you go back and do it properly.
  268.  
  269.      Explanation of Terms
  270.  
  271.      Please refer to this list of definitions when covering the following
  272.      sections.
  273.  
  274.      <code_list>
  275.      One or more lines of valid (syntax correct) Turbo Pascal source code.
  276.  
  277.      <conditional>
  278.      A Turbo Pascal conditional clause.
  279.  
  280.      Example: In the Turbo Pascal statement
  281.      If Color = 'Red' Then Exit
  282.      Color = 'Red' is the conditional clause.
  283.  
  284.      get_function()
  285.      A get_function() accepts user input, allows the user to edit the in-     put, and returns as the value of the function a specific Turbo Pascal
  286.      data type. The get_function() is the heart of io.tpu, a module of sub-
  287.      routines which form the basis of ScreenGen2. Three get_function()s
  288.      correspond to the three primary Turbo Pascal data types.
  289.  
  290.  
  291.      2The get_function()s are detailed in Appendix A, along with all of the
  292.      subroutines of io.tpu.
  293.  
  294.  
  295.  
  296.  
  297.               DataWrite Page 2 -- Copyright (C) Tika Software, Co.
  298. ────────────────────────────────────────────────────────────────────────────────
  299.  
  300.         get_string(default, option_list)
  301.         get_integer(default, option_list)
  302.         get_real(default, option_list);
  303.  
  304.      The fourth, get_menu(), allows the user to select from a highlighted
  305.      bar of choices, and returns a byte corresponding to the choice
  306.      selected.
  307.  
  308.         get_menu( menu, menuhelp, default, option_list)
  309.  
  310.      <menu>
  311.      A string sent as the first parameter in a get_menu() function call.
  312.      See the description of parameters for get_menu() in Appendix A.
  313.  
  314.      <menuhelp>
  315.      A string sent as the second parameter in a get_menu() function call.
  316.      See the description of parameters for get_menu() in Appendix A.
  317.  
  318.      #STATEMENT
  319.      A ScreenGen Reserved word, prefixed by the pound sign (#) and followed
  320.      by any number of parameters.
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.               DataWrite Page 3 -- Copyright (C) Tika Software, Co.
  358. ────────────────────────────────────────────────────────────────────────────────
  359.      ScreenGen
  360.  
  361.      ScreenGen assists the Turbo Pascal programmer who is called upon to
  362.      create data entry screens. Executed from the command line, ScreenGen
  363.      accepts a ScreenGen source file as input and generates a Turbo Pascal
  364.      source file capable of executing a full-function data entry screen.
  365.  
  366.                          SG.EXE                        TPC.EXE
  367.      ScreenGen -->       *----*    -->       Turbo Pascal        *-----* --
  368.      >    Object Code
  369.      Source Code    -->       *----*    -->       Source Code
  370.      *-----*   -->  (.EXE File)
  371.                          SG.EXE                        TPC.EXE
  372.                (ScreenGen Generator)              (Turbo Pascal Compiler)
  373.  
  374.      Command syntax
  375.  
  376.      SG <SOURCE_FILE> <OUTPUT_FILE>3
  377.  
  378.  
  379.  
  380.  
  381.      3Although not required, it is strongly suggested that ScreenWrite
  382.      source files be tagged .SW, that is: <FILENAME>.SW. ScreenWrite output
  383.      files should be tagged .SCR, that is: <FILENAME>.SCR. Thus the command
  384.      syntax becomes:
  385.      SW <SOURCE_FILE>.SW <OUTPUT_FILE>.SCR
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.               DataWrite Page 4 -- Copyright (C) Tika Software, Co.
  418. ────────────────────────────────────────────────────────────────────────────────
  419.      ScreenGen Overview
  420.  
  421.      Syntax
  422.  
  423.      <Screen Definition Section>
  424.      ##
  425.      <Global Definition Section>
  426.      <Variable Definition Section>
  427.      <END OF FILE>
  428.  
  429.      <Screen Definition Section>
  430.      A Picture of the Screen.
  431.  
  432.      <Global Definition Section>
  433.      A series of #STATEMENTS which detail characteristics global to the
  434.      screen. The Programmer may specify the format of the generated code,
  435.      as well as defaults for screen functionality.
  436.  
  437.      <Variable Definition Section>
  438.      A series of #DEFINE statements which assign variable names to the
  439.      fields identified in the <Screen Definition Section>. Additional
  440.      #STATEMENTS assign characteristics to the variables defined and enable
  441.      the user to specify input functionality for a given field.
  442.  
  443.      Output
  444.      ScreenGen has the ability to generate a screen in two formats.
  445.  
  446.      1) non_procedural
  447.         A series of get_function() calls, one per field.
  448.  
  449.      2) procedural
  450.         A complete Turbo Pascal procedure or function.
  451.  
  452.      [procedure | function] <screen_title>( display_status: string[] )[ :
  453.      byte ];
  454.      <declaration section>
  455.      begin
  456.                 with <data_record> do begin
  457.  
  458.                 if \1   Display non-fields (background)
  459.                 if \2   Display default field values.
  460.                 if \3   repeat
  461.                                 Edit Data
  462.                         until <escape_conditional>
  463.                 end; {with}
  464.      end; {subroutine}
  465.  
  466.      Selecting a procedural screen, the programmer generates a fully func-
  467.      tional sub-routine, which can be $Included in a Turbo Pascal Module.
  468.      The procedural screen enables an end-user to view a screen, fill the
  469.      screen and transfer the results to variables defined by the program-
  470.      mer.
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.               DataWrite Page 5 -- Copyright (C) Tika Software, Co.
  478. ────────────────────────────────────────────────────────────────────────────────
  479.      The screen performs three functions.
  480.      1) Display non-field (background) information.
  481.      2) Display default field values -- those values currently contained in
  482.      the Turbo variables corresponding to the fields.
  483.      3) Allow the user to step through each field adding or changing data.
  484.  
  485.      The programmer selects the function or functions desired by passing
  486.      '\1', '\2', and/or '\3' in the parameter display_status. For example,
  487.      A call to
  488.                         data_screen('\1\2');
  489.      displays the border information, and field values of a database, while
  490.      a call to:
  491.                         data_screen('\3');
  492.      allows the user to edit database screen fields.
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.               DataWrite Page 6 -- Copyright (C) Tika Software, Co.
  538. ────────────────────────────────────────────────────────────────────────────────
  539.      ScreenGen Reference Guide
  540.  
  541.      Readers of this section should first examine the ScreenGen Overview.
  542.  
  543.      File Specification
  544.  
  545.      To run ScreenGen, you need load only the ScreenGen executable file:
  546.      SG.EXE
  547.  
  548.      Code generated by ScreenGen must be linked to IO.TPU before executing.
  549.  
  550.      Command Structure and Syntax Detail (SDL)
  551.      <Screen Definition Section>
  552.  
  553.      The <Screen Definition Section> is made up of up to 24 <Screen Defini-
  554.      tion Line>s each containing:
  555.  
  556.      1) fields
  557.      2) non-fields (background)
  558.  
  559.      Fields consist of a combination of @s and non-blank format characters.
  560.      Examples of valid fields are:
  561.                 @@@@@@@@@       (field of length 9)
  562.                 @@@-@@-@@@@     (formatted field, length 10)
  563.  
  564.      Formatted fields are useful when storing items such as social security
  565.      numbers, as designated by the example above, dates (@@/@@/@@), and
  566.      telephone numbers ((@@@)-@@@-@@@@). The only restriction placed on a
  567.      formatted field is that it contain no blank characters, otherwise
  568.      ScreenGen will mistakenly interpret it as two separate fields.
  569.  
  570.      non-fields (background) are made up of any character beside the @ sym-
  571.      bol. Field titles, borders and blank lines are all examples of back-
  572.      ground.
  573.  
  574.      An example of a <Screen Definition Line> for an employee database
  575.      might be:
  576.  
  577.      Name: @@@@@@@@@@@@@@@@     Phone: (@@@)-@@@-@@@@   B-Day: @@/@@/@@
  578.  
  579.      The Phone and Birthday fields are formatted fields and will be stored
  580.      as string[10] and string[6] respectively.
  581.  
  582.      'Name:', 'Phone:', and 'B-Day:' comprise the background (non-field)
  583.      items on the line.
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.               DataWrite Page 7 -- Copyright (C) Tika Software, Co.
  598. ────────────────────────────────────────────────────────────────────────────────
  599.      <Global Definition Section>: OPTIONAL
  600.  
  601.      The <Global Definition Section> defines information pertinent to the
  602.      entire screen.
  603.  
  604.      #DATABASE, #SCREEN, #PROCEDURE and #FUNCTION are subroutine designa-
  605.      tion statements. They instruct ScreenGen to generate a procedural
  606.      screen. Absence of a subroutine designation #STATEMENT results in the
  607.      generation of a non-procedural screen (a linear series of get_func-
  608.      tion() calls). In the following examples, <file_title> refers to the
  609.      SG source file without the extension.
  610.  
  611.      #DATABASE <database_title>
  612.      Generates a Turbo Pascal procedure in this format:
  613.      procedure <database_title>_screen( display_status : string[15]);
  614.         begin
  615.                 with <database_title>_data do begin
  616.                 .
  617.                 if \1 then draw screen background
  618.                 .
  619.                 if \2 then echo default fields
  620.                 .
  621.                 if \3 then repeat
  622.                         get_function() calls
  623.                 until <escape_conditional>
  624.                 .
  625.                 end; {with}
  626.         end; {procedure}
  627.      This option is generally used in conjunction with DataGen.
  628.      <database_title> default = <file_title>
  629.      <escape_conditional> default = 'in_keycode = k_escape'
  630.  
  631.      #SCREEN <screen_title>
  632.      Generates a Turbo Pascal procedure in this format:
  633.      procedure <screen_title>( display_status : string[15]);
  634.         begin
  635.                 if \1 then draw screen background
  636.                 .
  637.                 if \2 then echo default fields
  638.                 .
  639.                 if \3 then repeat
  640.                         get_function() calls
  641.                 until <escape_conditional>
  642.         end; {procedure}
  643.  
  644.      <screen_title> default = <file_title>_screen
  645.      <escape_conditional> default = 'in_keycode = k_escape'
  646.  
  647.      #PROCEDURE <procedure_title>
  648.      Generates a Turbo Pascal procedure in this format:
  649.      procedure <procedure_title>( display_status : string[15]);
  650.         begin
  651.                 if \1 then draw screen background
  652.  
  653.  
  654.  
  655.  
  656.               DataWrite Page 8 -- Copyright (C) Tika Software, Co.
  657. ────────────────────────────────────────────────────────────────────────────────
  658.                 .
  659.                 if \2 then echo default fields
  660.                 .
  661.                 if \3 then repeat
  662.                         get_function() calls
  663.                 until <escape_conditional>
  664.         end; {procedure}
  665.  
  666.      <procedure_title> default = <file_title>_screen
  667.      <escape_conditional> default = 'in_keycode = k_escape'
  668.  
  669.  
  670.      #FUNCTION <function_title>
  671.      Generates a Turbo Pascal function in this format:
  672.      function <function_title>( display_status : string[15]) : byte;
  673.         begin
  674.                 if \1 then draw screen background
  675.                 .
  676.                 if \2 then echo default fields
  677.                 .
  678.                 if \3 then repeat
  679.                         get_function() calls
  680.                 until <escape_conditional>
  681.         end; {procedure}
  682.  
  683.      <function_title> default = <file_title>_screen
  684.      <escape_conditional> default = 'in_keycode = k_escape'
  685.      The return value of the function should be set by the programmer using
  686.      #BEFORE/#AFTER.
  687.  
  688.      #OVERLAY
  689.      Generates an Overlay Procedure or function. Must be used in conjunc-
  690.      tion with #DATABASE, #SCREEN, #PROCEDURE or #FUNCTION.
  691.  
  692.      #WITH <record_title>
  693.      Generates a with statement. Must be used in conjunction with #SCREEN,
  694.      #PROCEDURE or #FUNCTION (#DATABASE automatically forces the generation
  695.      of a with statement).
  696.      <record_title> default = <file_title>_data
  697.  
  698.      #ESCAPE <escape_conditional>
  699.      Default: in_keycode = k_escape
  700.      Sets the <escape_conditional> in the generated procedure/function (see
  701.      above).
  702.  
  703.      #TYPE [ String | Integer | Real ]
  704.      Default: String
  705.      Sets the default data_type = 'String', 'Integer' or 'Real'.
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.               DataWrite Page 9 -- Copyright (C) Tika Software, Co.
  717. ────────────────────────────────────────────────────────────────────────────────
  718.  
  719.      #BEFORE <code_list>
  720.      #AFTER <code_list>
  721.      Used to insert Turbo Pascal source into the ScreenGen output file.
  722.      Placement of the code depends upon placement of the #BEFORE/#AFTER
  723.      statement. If we consider #SUBROUTINE to be #DATABASE, #SCREEN, #PRO-
  724.      CEDURE, or #FUNCTION, then placement of #BEFORE/#AFTER code in the
  725.      resultant procedure/function follows.
  726.  
  727.  
  728.      CASE 1: #BEFORE/#AFTER follows #SUBROUTINE.
  729.  
  730.      From the source code:
  731.  
  732.      #SUBROUTINE foo
  733.      #BEFORE <before_code>
  734.         .
  735.         .
  736.      #AFTER <after_code>
  737.         .
  738.         .
  739.      ##
  740.  
  741.      ScreenGen generates the Turbo Pascal code:
  742.  
  743.      subroutine foo
  744.      begin
  745.                 {with foo_data do begin [if designated])
  746.                 <before_code>
  747.                         .
  748.                         .
  749.                 body of subroutine...
  750.                         .
  751.                         .
  752.                 <after_code>
  753.                         .
  754.                         .
  755.                 {end with, if designated}
  756.      end; {subroutine}
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.              DataWrite Page 10 -- Copyright (C) Tika Software, Co.
  777. ────────────────────────────────────────────────────────────────────────────────
  778.  
  779.      CASE 2: #BEFORE/#AFTER Precedes #SUBROUTINE
  780.  
  781.      From the source code:
  782.  
  783.      #BEFORE <before_code>
  784.         .
  785.         .
  786.      #AFTER <after_code>
  787.         .
  788.         .
  789.  
  790.      #SUBROUTINE foo
  791.      ##
  792.  
  793.      ScreenGen generates the Turbo Pascal code:
  794.  
  795.                 <before_code>
  796.                         .
  797.                         .
  798.      subroutine foo
  799.      begin
  800.                 {with foo_data do begin [if designated])
  801.                 body of subroutine...
  802.                         .
  803.                         .
  804.                 {end with, if designated}
  805.      end; {subroutine}
  806.  
  807.                 <after_code>
  808.                         .
  809.                         .
  810.  
  811.      #DECLARE <code_list>
  812.      Used to insert variable declarations into the ScreenGen output file.
  813.      Code is placed in the declaration section of the resultant subroutine.
  814.  
  815.      From the source code:
  816.      #SUBROUTINE
  817.      #DECLARE <declaration_code_list>
  818.         .
  819.         .
  820.      ##
  821.  
  822.      ScreenGen generates the Turbo Pascal code:
  823.  
  824.      subroutine foo
  825.      <declaration code_list>
  826.         .
  827.         .
  828.      begin
  829.                 {with foo_data do begin [if designated])
  830.                 body of subroutine...
  831.  
  832.  
  833.  
  834.  
  835.  
  836.              DataWrite Page 11 -- Copyright (C) Tika Software, Co.
  837. ────────────────────────────────────────────────────────────────────────────────
  838.                         .
  839.                         .
  840.                 {end with, if designated}
  841.      end; {subroutine}
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.              DataWrite Page 12 -- Copyright (C) Tika Software, Co.
  897. ────────────────────────────────────────────────────────────────────────────────
  898.      <Variable Definition Section>
  899.  
  900.      For each field defined in the <Screen Definition Section> ScreenGen
  901.      requires a #DEFINE statement to appear in the <Variable Definition
  902.      Section>. #STATEMENTS which follow the #DEFINE for a given variable
  903.      act as qualifying commands for that variable.
  904.  
  905.      The following is a list of legal <Variable Definition Section> #STATE-
  906.      MENTS with descriptions:
  907.  
  908.      #DEFINE <variable>
  909.      Assigns the name <variable> to the next Field as indicated in the
  910.      <Screen Definition Section>. A get_function is generated for the <var-
  911.      iable> unless it is designated #DISPLAY (see #DISPLAY below). Fields
  912.      are assigned in a top down manner from left to right.
  913.  
  914.      #OPTIONS <option_list>
  915.      Appends <option_list> to the get_function() for the corresponding
  916.      #DEFINEd variable.
  917.  
  918.      #BEFORE <code_list>
  919.      <code_list> will be executed prior to execution of the get_function()
  920.      for the #DEFINEd variable.
  921.      #AFTER <code_list>
  922.      <code_list> will be executed following execution of the get_function()
  923.      for the #DEFINEd variable.
  924.  
  925.      #MENU <menu>
  926.      a get_menu() call will be generated for the #DEFINEd variable with
  927.      <menu> as the first parameter.
  928.  
  929.      #PROMPT <menu>
  930.      a get_menu() call will be generated for the #DEFINEd variable with
  931.      <menu> as the first parameter, and \px and \py set to the field loca-
  932.      tion. As a result the menu selection appears in the field location as
  933.      well as being highlighted on the menu.
  934.  
  935.      ## <comment_list>
  936.      Allows the user of SG to comment source code. <comment_list> is not
  937.      transferred to the resultant Turbo source. ## also separates the
  938.      <Screen Definition Section> from the <Variable Definition Section>.
  939.  
  940.      #VIEWORDER <vieworder_spec>
  941.      specifies the
  942.  
  943.      #VERIFY <turbo_conditional>
  944.      After editing the #DEFINEd field, this <turbo_conditional> is tested,
  945.      before continuing.
  946.  
  947.      Example:   #DEFINE this_field
  948.                 #VERIFY this_field > 17
  949.  
  950.      #ERROR <error_message>
  951.  
  952.  
  953.  
  954.  
  955.  
  956.              DataWrite Page 13 -- Copyright (C) Tika Software, Co.
  957. ────────────────────────────────────────────────────────────────────────────────
  958.      <error_message>  is displayed if the <turbo_conditional> of the
  959.      #VERIFY command is not met.
  960.  
  961.      Example:   #DEFINE this_field
  962.                 #VERIFY this_field > 17
  963.                 #ERROR  This field must be at least 18, you twit.
  964.  
  965.      #DISPLAY
  966.      Sets the #DEFINEd variable to display only. No editing of the field
  967.      will be allowed.
  968.  
  969.      #HELP <menuhelp>
  970.      If the #DEFINEd field is a menu field, <menuhelp> is offered as the
  971.      second parameter of the get_menu() call.
  972.  
  973.      #TYPE [ String | Integer | Real ]
  974.      Default: String     parameter = String         : A get_string() call is generated.
  975.      parameter = Integer                : A get_integer() call is genera-
  976.      ted.
  977.      parameter = Real           : A get_real() call is generated.
  978.  
  979.      To generate a get_menu() call, see #MENU.
  980.  
  981.      #VIDEO [ bright | dim | reverse | no_color ]
  982.      Default: no_color
  983.      Sets the display intensity for a field.
  984.  
  985.      #VIEWORDER <view_list>
  986.      Allows the programmer to specify the next field to be edited for each
  987.      exit keystroke (e.g. carriage return, cursor up...). By default, a
  988.      call to vieworder() (part of io.tpu) is generated following each
  989.      get_function(). ScreenGen tries to best guess the intentions of the
  990.      programmer regarding the order of field traversal, based on top-down,
  991.      left-right. Under certain circumstances, it may be necessary to change
  992.      the default order of field traversal. <view_list> is a string contain-
  993.      ing one or more of the following:
  994.  
  995.         \crn    On carriage return goto field n
  996.         \ucn    On up cursor goto field n
  997.         \dcn    On down cursor goto field n
  998.         \tabn   On tab goto field n
  999.         \btabn  On backtab (Shift+tab) goto field n
  1000.         \escn   On escape goto field n
  1001.  
  1002.      In all cases, n must be a valid field number. Fields are implicitly
  1003.      numbered starting from 1, top-left to bottom-right.
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.              DataWrite Page 14 -- Copyright (C) Tika Software, Co.
  1017. ────────────────────────────────────────────────────────────────────────────────
  1018.  
  1019.      ScreenGen Sample Screens
  1020.  
  1021.      Screen 1:  Employee Screen
  1022.      Name:      @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  1023.      Street1:   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  1024.      Street2:   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  1025.      City:      @@@@@@@@@@@@@@@@@@@@@@@@  State: @@  Zip: @@@@@@@@@@@
  1026.      Phone:     @@@-@@@-@@@@    Social Security:        @@@-@@-@@@@
  1027.      ##
  1028.      ##         Global Declaration Section
  1029.      ##
  1030.  
  1031.      #screen employee_screen
  1032.      #with employee_data_record
  1033.  
  1034.      ##
  1035.      ##         Variable Declaration Section
  1036.      ##
  1037.  
  1038.      #define name
  1039.      ## Capitalize the First letter of name
  1040.         #option \g
  1041.      ## Highlight the Name for easy scanning
  1042.         #video bright
  1043.      #define street1
  1044.      #define street2
  1045.      #define city
  1046.      #define state
  1047.      ## Force the characters of state to uppercase
  1048.         #options \u
  1049.      #define zip
  1050.      #define phone
  1051.      #define soc_sec
  1052.      ## Although stored as a string, a social security number contains
  1053.      ## only numeric digits
  1054.         #options \ci
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.              DataWrite Page 15 -- Copyright (C) Tika Software, Co.
  1077. ────────────────────────────────────────────────────────────────────────────────
  1078.      ScreenGen Sample Screens, Continued
  1079.  
  1080.      Screen2: Sales Screen              Records on File:        @@@@@     Company:   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  1081.      Contact:   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  1082.  
  1083.      Phone: (w) @@@-@@@-@@@@    (h) @@@-@@@-@@@@
  1084.  
  1085.      Date of First Call:        @@/@@/@@ Last:  @@/@@/@@
  1086.      Resolution of Call: @@@@@@@@@@@@@@@@
  1087.  
  1088.      Notes:     @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  1089.      @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  1090.      @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  1091.      ##
  1092.      ## Global Definition Section
  1093.      ##
  1094.      #procedure sales_screen
  1095.      #with sales_data
  1096.      ##
  1097.      ## Variable Definition Section
  1098.      ##
  1099.      #define usedrecs( sales_file )
  1100.      ##
  1101.      ## Sometimes, variables may actually be subroutine calls
  1102.      ## which return a specific Turbo type.
  1103.      ## usedrecs() is a Turbo Database Toolbox routine.
  1104.      ## It is of type integer, and must be set to display only.
  1105.      ##
  1106.         #type integer
  1107.         #display
  1108.  
  1109.      #define company
  1110.         #options \g
  1111.      #define contact
  1112.      #define work_phone
  1113.      #define home_phone
  1114.      #define first_call_date
  1115.      #define last_call_date
  1116.      #define call_resolution
  1117.         #prompt \1Call Again\2No Deal\3Sale
  1118.         #help \1When at First you don''t succeed\2Forget it\3Yeah!
  1119.      ##
  1120.      ## Notice the use of the double '' in the #help call.
  1121.      ## When the #help is converted, the parameter becomes a Turbo
  1122.      ## Pascal string. Since a single quotation mark signifies
  1123.      ## the end of a string, a double mark must be used.
  1124.      ##
  1125.      #define notes1
  1126.      #define notes2
  1127.      #define notes3
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.              DataWrite Page 16 -- Copyright (C) Tika Software, Co.
  1136. ────────────────────────────────────────────────────────────────────────────────
  1137.      ScreenGen Sample Screens, Continued
  1138.  
  1139.      Screen 3: Help Screen
  1140.  
  1141.      This is an example of how a ScreenGen programmer might define a Help
  1142.      Screen. It contains a useful information about running an application
  1143.      that would be brought up under a [HELP] option. In this example, we
  1144.      direct that the screen be generated as a function, returning a byte to
  1145.      the calling routine which signifies display next (1), or Return to Ap-
  1146.      plication (2). The Turbo Pascal variable exit_menu is local to the
  1147.      generated function, declared using #DECLARE, initialized in the #BE-
  1148.      FORE code and passed to the function in the #AFTER code.
  1149.  
  1150.      Turn off VCR                               ----    ALT-F1
  1151.      Make pizza                         ----    ALT-F2
  1152.      Take my wife, please                       ----    ALT-F3
  1153.  
  1154.  
  1155.  
  1156.  
  1157.      @@@@@@@@@@
  1158.      ##
  1159.      ## Global Definition Section
  1160.      ##
  1161.      #function help_screen
  1162.      #declare var exit_menu : byte;
  1163.      #before exit_menu := 1;
  1164.      #after help_screen := exit_menu;
  1165.  
  1166.      ## Variable Definition Section
  1167.  
  1168.      #define exit_menu
  1169.         #menu \1Next\2Return
  1170.         #help \1Display Next Help Screen\2Return to Application
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.              DataWrite Page 17 -- Copyright (C) Tika Software, Co.
  1196. ────────────────────────────────────────────────────────────────────────────────
  1197.  
  1198.      DataGen
  1199.  
  1200.      DataGen assists Turbo Pascal programmers who wish to create simple
  1201.      database applications. Executed from the command line, DataGen accepts
  1202.      a DataGen source file as input and generates a Turbo Pascal Source
  1203.      file capable of executing a full-function database. Source code may be
  1204.      generated in TURBO DATABASE TOOLBOX, or BTRIEVE format.
  1205.  
  1206.                          DG.EXE                        TPC.EXE
  1207.      DataGen   -->       *----*    -->       Turbo Pascal        *-----* --
  1208.      >    Object Code
  1209.      Source Code    -->       *----*    -->       Source Code
  1210.      *-----*   -->  (.EXE File)
  1211.                          DG.EXE                        TPC.EXE
  1212.                (DataGen Generator)           (Turbo Pascal Compiler)
  1213.  
  1214.      Command syntax
  1215.  
  1216.      DG <SOURCE_FILE> [/b]
  1217.  
  1218.      The /b parameter indicates generation of a database in BTRIEVE format.
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.              DataWrite Page 18 -- Copyright (C) Tika Software, Co.
  1256. ────────────────────────────────────────────────────────────────────────────────
  1257.  
  1258.      DataGen Overview
  1259.  
  1260.      Syntax
  1261.  
  1262.      DataGen syntax is a subset of ScreenGen source syntax. To create a
  1263.      database using DataGen, follow these steps:
  1264.  
  1265.      1)   Design a screen using ScreenGen SDL
  1266.           Tag the file .sg, that is <SOURCE_FILE>.sg
  1267.  
  1268.      2)   Make the following changes to the ScreenGen source:
  1269.           a)   include the command #DATABASE in the <Global Definition Sec-
  1270.      tion>
  1271.  
  1272.           b)   using #INDEX, label each variable that you wish to utilize
  1273.                as a search key. The #INDEX is a <Variable Definition Sec-
  1274.                tion> #STATEMENT and should be included following the
  1275.                #DEFINE statement for a given variable. At least one vari-
  1276.                able must be #INDEXed per database. #INDEXed variables must
  1277.                be of #TYPE string.
  1278.  
  1279.      3)   Execute:  DG <SOURCE_FILE>.sg
  1280.           Execute:  Make -f<SOURCE_FILE>.mkf
  1281.  
  1282.      DataGen creates the executable file <SOURCE_FILE>.exe. Run this file
  1283.      to execute the database.
  1284.  
  1285.      Output
  1286.  
  1287.      DataGen generates database code in two formats.
  1288.  
  1289.      TURBO DATABASE TOOLBOX format
  1290.      BTRIEVE format
  1291.  
  1292.      DataGen creates three files from <SOURCE_FILE>.sg:
  1293.      <SOURCE_FILE>.pas   : Turbo Pascal .pas file
  1294.      <SOURCE_FILE>.typ   : Record Definition Include file to <SOUR-
  1295.      CE_FILE>.pas
  1296.      <SOURCE_FILE>.mkf   : Makefile for <SOURCE_FILE>.exe
  1297.  
  1298.  
  1299.      For each field #DEFINEd in <SOURCE_FILE>.sg, DataGen generates a Turbo
  1300.      Pascal identifier in <SOURCE_FILE>.typ. Each identifier is part of a
  1301.      Record called
  1302.      <SOURCE_FILE>_structure. For example, the .sg file
  1303.      geneva.sg:
  1304.  
  1305.      Name: @@@@@@@@@@@@@@@@@@@@@@@@@
  1306.      Rank:     @@@@@@@@@@     Serial Number: @@@@@@@@@@@-@@@
  1307.      ##
  1308.      #database
  1309.      #define name
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.              DataWrite Page 19 -- Copyright (C) Tika Software, Co.
  1316. ────────────────────────────────────────────────────────────────────────────────
  1317.           #index
  1318.      #define rank
  1319.      #define serial_number
  1320.  
  1321.      yields the .typ file geneva.typ
  1322.  
  1323.      type geneva_structure = record
  1324.           status : longint;
  1325.           name : string[25];
  1326.           rank : string[10];
  1327.           serial_number : string[14];
  1328.      end; {record}
  1329.  
  1330.      The status field is generated for TURBO DATABASE TOOLBOX format data-
  1331.      bases only, and is used to track deleted records.
  1332.  
  1333.      Editing Turbo Source
  1334.  
  1335.      Once DataGen generates the source files, they may be edited prior to
  1336.      compilation. To do so, one should have a working knowledge of io.tpu,
  1337.      as a significant amount of the resultant source calls subroutines
  1338.      within the i/o module.
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.              DataWrite Page 20 -- Copyright (C) Tika Software, Co.
  1376. ────────────────────────────────────────────────────────────────────────────────
  1377.  
  1378.      DataGen Reference
  1379.  
  1380.      File Specification
  1381.  
  1382.      To execute DataGen, the following files must be loaded:
  1383.  
  1384.      DG.EXE:        The DataGen program
  1385.      DG.DAT:        DataGen Source Data (Turbo Toolbox)
  1386.      IO.TPU:        Input/Output Subroutine Module
  1387.  
  1388.      If BTRIEVE format is selected, the files:
  1389.  
  1390.      BTRIEVE.DAT:   DataGen BTRIEVE Source Data
  1391.      T4BTRV.TPU:    BTRIEVE Link Module for Turbo Pascal
  1392.  
  1393.      must also be loaded.
  1394.  
  1395.  
  1396.      Command Structure
  1397.  
  1398.      DataGen generates code from a modified ScreenGen source file. The     #STATEMENTs utilized by the DataGen generator are listed by section.
  1399.      #STATEMENTs not recognized by DataGen, but which appear in the .sg
  1400.      file will produce the warning: ** ASSUMED COMMENT ** followed by the
  1401.      text of the source line.
  1402.  
  1403.      <Global Definition Section>
  1404.  
  1405.      #DATABASE - See definition in ScreenGen Reference.
  1406.  
  1407.      <Variable Definition Section>
  1408.  
  1409.      #DEFINE <variable>
  1410.      Generates a Turbo Pascal identifier called <variable> as a member of
  1411.      the data record <SOURCE_FILE>_structure. The record field will have
  1412.      the Turbo Pascal data type as indicated by #TYPE (or the default for
  1413.      the <variable>). If the <variable> is of #TYPE string, it's length is
  1414.      calculated as the length of the field defined in the <Screen Defini-
  1415.      tion Section>.
  1416.  
  1417.      #MENU <menu>
  1418.      The #DEFINEd variable will be generated as type byte.
  1419.  
  1420.      #PROMPT <menu>
  1421.      The #DEFINEd variable will be generated as type byte.
  1422.  
  1423.      ## <comment_list>
  1424.      Allows the user of DG to comment source code. <comment_list> is not
  1425.      transferred to the resultant Turbo source. ## also separates the
  1426.      <Screen Definition Section> from the <Variable Definition Section>.
  1427.  
  1428.      #INDEX
  1429.      Indicates that the #DEFINEd field will be a search key. The field must
  1430.      be of #TYPE string.
  1431.  
  1432.  
  1433.  
  1434.  
  1435.              DataWrite Page 21 -- Copyright (C) Tika Software, Co.
  1436. ────────────────────────────────────────────────────────────────────────────────
  1437.  
  1438.      #TYPE [ String | Integer | Real ]
  1439.      Default: String
  1440.      parameter = String       : A variable of type string[] is generated
  1441.      parameter = Integer : A variable of type integer is generated
  1442.      parameter = Real         : A variable of type real is generated
  1443.  
  1444.      #NOTDATA
  1445.      No identifier is generated for this field.
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.  
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.              DataWrite Page 22 -- Copyright (C) Tika Software, Co.
  1496. ────────────────────────────────────────────────────────────────────────────────
  1497.  
  1498.      APPENDIX A: Examination of IO.TPU
  1499.  
  1500.      function get_string(default, option_list) : string[255];
  1501.  
  1502.      Accepts:  default - string[255]
  1503.                option_list -  string[80]
  1504.      Returns:  string, max length 255, as the value of the function
  1505.  
  1506.      Function: get_string() presents the user with an editing buffer con-
  1507.      taining the default string. Using Cursor keys, the user may change or
  1508.      add characters to the buffer. get_string() returns the altered string
  1509.      as the value of the function.
  1510.  
  1511.      option_list is a string comprised of any of the following.
  1512.  
  1513.      \q   <query>
  1514.      The associated <query> is printed as a prompt to the user for entry of
  1515.      data into the field.
  1516.  
  1517.      \d
  1518.      Display only: no data is to be entered into the field.
  1519.  
  1520.      \af
  1521.      Auto Forward: Exit from the routine occurs when the number of charac-
  1522.      ters in the field surpass the allocated size.
  1523.  
  1524.      \ab
  1525.      Auto Back: Exit from the routine occurs if the user hits a backspace
  1526.      when the field is empty.
  1527.  
  1528.      \g
  1529.      Capitalize: Upon exiting, the first character in the field is Capital-
  1530.      ized.
  1531.  
  1532.      \u
  1533.      Uppercase: Characters are forced to upper-case.
  1534.  
  1535.      \xnn
  1536.      Goto Xpos: Field location is set to Xpos nn.
  1537.  
  1538.      \ynn
  1539.      Goto Ypos: Field location is set to Ypos nn.
  1540.  
  1541.      \lnn
  1542.      Length: The maximum length of the field is set to nn characters.
  1543.  
  1544.      \fxxxxxxxx
  1545.      Format string: Data is to be entered in a formatted fashion, based on
  1546.      the format string xxxxxxxx. xxxxxxxx may contain any non-blank charac-
  1547.      ters. At symbols (@) indicate location for character entry.
  1548.      \cx
  1549.      Valid characters:   Limits the keystrokes accepted for data entry into
  1550.      the field.
  1551.  
  1552.  
  1553.  
  1554.  
  1555.              DataWrite Page 23 -- Copyright (C) Tika Software, Co.
  1556. ────────────────────────────────────────────────────────────────────────────────
  1557.                     x = '*' : Any Alphanumeric Character                    x = 'i' : Numeric Character only
  1558.                     x = 'r' : Numeric and Period (.) for entry of floating
  1559.      point numbers
  1560.  
  1561.      \kxxxxxxxxxxxxxxxx
  1562.      Return Keystrokes: Sets the keystrokes indicating exit from get_str-
  1563.      ing(). xxxxxxxxxxxxxxxx is a concatenation of the following
  1564.      'cr'      return on           carriage return
  1565.      'uc'           up_cursor
  1566.      'dc'           down_cursor
  1567.      'tab'          tab
  1568.      'btab'         Backtab (Shift+Tab)
  1569.      'esc'               Escape key
  1570.  
  1571.      \vix
  1572.      Video in: Sets the video attribute for field data entry
  1573.      x='b'     bright (normal video)
  1574.      x='d'     dim (low video)
  1575.      x='r'     reverse (reverse video)
  1576.  
  1577.      \vox
  1578.      Video out: Sets the video attribute for field upon exit.
  1579.      x='b','d','r' (see \vi above)
  1580.  
  1581.      Examples:
  1582.      Chair := get_string( 'Wicker', '\qEnter Chair Type:\x10\y15\l30');
  1583.  
  1584.      1. Assign input to the string variable Chair. Default value is the
  1585.      character string 'Wicker'. String input is accompanied by the query
  1586.      'Enter Chair Type:'. Length of the string should not exceed 30. Input
  1587.      takes place at screen position xpos=10, ypos=15.
  1588.  
  1589.      Today := get_string( system_date, '\qEnter Date\f@@/@@/@@\x3\y5');
  1590.  
  1591.      2. Assign input to the string variable Today. Default value is the 6
  1592.      character string variable system_date. String input is accompanied by
  1593.      the query 'Enter Date'. The string is to be entered in a formatted
  1594.      manner defined by the format string '@@/@@/@@'. Input takes place at
  1595.      screen position xpos=3, ypos=5.
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.              DataWrite Page 24 -- Copyright (C) Tika Software, Co.
  1615. ────────────────────────────────────────────────────────────────────────────────
  1616.      function get_menu( menu, menuhelp, default, option_list ) : byte;
  1617.  
  1618.      Accepts:  menu - string[255]
  1619.                menuhelp - string[255]
  1620.                default - byte
  1621.                option_list - string[255]
  1622.  
  1623.      Returns:  byte as the value of the function
  1624.  
  1625.      Function: get_menu() presents the user with a list of menu choices
  1626.      passed in the menu, and menuhelp parameters. The user may select the
  1627.      desired choice by highlighting it and pressing return, or by pressing
  1628.      the first letter of that choice. get_menu() returns a byte correspond-
  1629.      ing to the choice number selected by the user.
  1630.  
  1631.      The trick to using get_menu() is understanding the format of the menu
  1632.      parameter. It must be in the following format.
  1633.  
  1634.      '\1First Choice\2Second Choice\3Third Choice... \9Last Choice'
  1635.  
  1636.      A maximum of nine (9) choices may appear for each menu. Choices may be
  1637.      clarified in the menuhelp parameter which appears directly under the
  1638.      highlighted choice.
  1639.  
  1640.      '\1This is the First Choice\2And the Second Choice... \9No more
  1641.      Choices'
  1642.  
  1643.      The default parameter should contain the number corresponding to the
  1644.      selection you wish highlighted upon presentation of the menu.
  1645.  
  1646.      option_list is a string comprised of any of the following.
  1647.  
  1648.      \q   <query>
  1649.      The associated <query> is printed as a prompt to the user for entry of
  1650.      data into the field.
  1651.  
  1652.      \d
  1653.      Display only: no data is to be entered into the field.
  1654.  
  1655.      \kxxxxxxxxxxxxxxxx
  1656.      Return Keystrokes: Sets the keystrokes indicating exit from get_str-
  1657.      ing(). xxxxxxxxxxxxxxxx is a concatenation of the following
  1658.      'cr'      return on      carriage return
  1659.      'uc'                up_cursor
  1660.      'dc'                down_cursor
  1661.      'tab'                    tab
  1662.      'btab'                   Backtab (Shift+Tab)
  1663.      'esc'                    Escape key
  1664.      \vix
  1665.      Video in: Sets the video attribute for field data entry
  1666.      x='b'     bright (normal video)
  1667.      x='d'     dim (low video)
  1668.      x='r'     reverse (reverse video)
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.              DataWrite Page 25 -- Copyright (C) Tika Software, Co.
  1675. ────────────────────────────────────────────────────────────────────────────────
  1676.  
  1677.      \vox
  1678.      Video out: Sets the video attribute for field upon exit.
  1679.      x='b','d','r' (see \vi above)
  1680.  
  1681.      \mxn
  1682.      Menu Xposition: n specifies the x screen coordinate at which the menu
  1683.      should appear.
  1684.  
  1685.      \myn
  1686.      Menu Yposition: n specifies the y screen coordinate at which the menu
  1687.      should appear.
  1688.  
  1689.      \pxn
  1690.      Prompt Xposition: If this option is included, get_menu() will echo the
  1691.      current menu selection at x screen coordinate n.
  1692.  
  1693.      \pyn
  1694.      Prompt Yposition: If this option is included, get_menu() will echo the
  1695.      current menu selection at y screen coordinate n.
  1696.  
  1697.      Example:
  1698.      Fruit := get_menu( '\1Apple\2Orange, '\1Big, Red and Juicy\2Sweet,
  1699.      slightly tart', 1,  '\qEnter Fruit Type:\mx10\my15');
  1700.  
  1701.      1. Assign input to the variable Fruit (type byte). The value of Fruit
  1702.      will be set to 1, or 2 based on whether the user selects 'Apple' or
  1703.      'Orange' from the menu. It will appear an Xposition 10 and Yposition
  1704.      15, preceded by the query 'Enter Fruit Type'. The default menu selec-
  1705.      tion is 'Apple', which will be highlighted when the menu appears.
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.              DataWrite Page 26 -- Copyright (C) Tika Software, Co.
  1735. ────────────────────────────────────────────────────────────────────────────────
  1736.      function get_integer( default, option_list ) : integer;
  1737.  
  1738.      Accepts:  default - integer
  1739.                option_list - string[255]
  1740.  
  1741.      Returns:  integer, as the value of the function.
  1742.  
  1743.      Function: get_integer() allows the user to enter and change an in-
  1744.      teger. It has the same functionality as get_string().
  1745.  
  1746.      option_list is a string comprised of all of the options available
  1747.      within get_string(), plus the following.
  1748.  
  1749.      \lbnnnnnn
  1750.      Lower Bound: The integer entered by the user must be at least nnnnnn.
  1751.  
  1752.      \ubnnnnnn
  1753.      Upper Bound: The integer entered by the user must be at most nnnnnn.
  1754.  
  1755.  
  1756.  
  1757.      function get_real( default, option_list ) : real;
  1758.  
  1759.      Accepts:  default - real
  1760.                option_list - string[255]
  1761.  
  1762.      Returns:  real, as the value of the function.
  1763.  
  1764.      Function: get_real() allows the user to enter and change a real. It
  1765.      has the same functionality as get_string().
  1766.  
  1767.      option_list is a string comprised of all of the options available
  1768.      within get_string(), plus the following.
  1769.      \lbnnnnnn
  1770.      Lower Bound: The real entered by the user must be at least nnnnnn.
  1771.  
  1772.      \ubnnnnnn
  1773.      Upper Bound: The real entered by the user must be at most nnnnnn.
  1774.  
  1775.  
  1776.      Note: Both get_integer() and get_real() call get_string().
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.              DataWrite Page 27 -- Copyright (C) Tika Software, Co.
  1795. ────────────────────────────────────────────────────────────────────────────────
  1796.      procedure scan;
  1797.  
  1798.      Sets:     in_keycode - keystroke
  1799.                in_chr - char
  1800.  
  1801.      Function: Accepts a keystroke from the keyboard. Sets the two global
  1802.      variables:
  1803.  
  1804.      in_keycode: a scaler variable of type keystroke with a value of:
  1805.  
  1806.      k_cr, k_escape, k_down_cursor, k_up_cursor, k_left_cursor,
  1807.      k_right_cursor, k_bs, k_tab, k_del, k_linefeed, k_ctrl_right,
  1808.      k_ctrl_left, k_home, k_end, k_ctrl_K, k_ctrl_Y,
  1809.      k_pgup, k_pgdn, k_backtab, k_ascii, k_invalid
  1810.  
  1811.      in_chr: char, that accepted by scan; Set to the ascii character when
  1812.      in_keycode = k_ascii.
  1813.  
  1814.  
  1815.      function format( format_string, format_shell, string_index ) :
  1816.      string[];
  1817.  
  1818.      Accepts:  format_string - string[255]
  1819.                format_shell - string[255]
  1820.  
  1821.      Returns:  string_index - byte
  1822.                string[255] as the value of the function
  1823.      Function: Using format_shell as a guide, format() returns a formatted
  1824.      version of the passed string as the value of the function.
  1825.      string_index is set to the character location of the last non-format
  1826.      character in the returned string.
  1827.  
  1828.      format_shell consists of a combination of @s and non-blank format
  1829.      characters. Examples of a valid format_shell are:
  1830.  
  1831.                @@/@@/@@  (Date)
  1832.                @@@-@@-@@@@    (Social Security Number)
  1833.                22-@@@@@@@@@   (Federal ID)
  1834.  
  1835.      Sample Call:        format('122269', 'H@@@@-@@@DF@@@', s_index );
  1836.      Returns 'H1222-69 DF' as the value of the function, and sets
  1837.      string_index = 8.
  1838.  
  1839.      function atoi( ascii_int ) : integer
  1840.  
  1841.      Accepts:  ascii_int - string representation of an integer;
  1842.      Returns:  integer, as the value of the function
  1843.  
  1844.      Function: Converts a string into the integer which it represents.
  1845.  
  1846.      Sample Call:        atoi('12')
  1847.      Returns the integer 12 as the value of the function.
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.              DataWrite Page 28 -- Copyright (C) Tika Software, Co.
  1855. ────────────────────────────────────────────────────────────────────────────────
  1856.      function itoa( integer ) : string[]
  1857.  
  1858.      Accepts:  integer
  1859.      Returns:  string[] representation of integer as the value of the func-
  1860.      tion
  1861.  
  1862.      Function: Converts an integer into a string which represents it.
  1863.  
  1864.      Sample Call:        itoa( 966 )
  1865.      Returns the string '966' as the value of the function.
  1866.  
  1867.      function ator( ascii_real ) : real
  1868.  
  1869.      Accepts:  ascii_real - string representation of a real number;
  1870.      Returns:  real, as the value of the function
  1871.  
  1872.      Function: Converts a string into the real which it represents.
  1873.  
  1874.      Sample Call:        ator('16.35')
  1875.      Returns the real number 16.35 as the value of the function.
  1876.      function rtoa( real_number ) : string[]
  1877.  
  1878.      Accepts:  real_number - real
  1879.      Returns:  string[] representation of real_number as the value of the
  1880.      function
  1881.  
  1882.      Function: Converts a real number into a string which represents it.
  1883.  
  1884.      Sample Call:        rtoa( 11.44 )
  1885.      Returns the string '11.44' as the value of the function.
  1886.  
  1887.      function capitalize( in_string ) : string[]
  1888.  
  1889.      Accepts:  in_string - string[255]
  1890.      Returns:  string[] as the value of the function
  1891.  
  1892.      Function: The first letter of each word in string[] (separated by
  1893.      blanks) is capitalized.
  1894.  
  1895.      Sample Call:        capitalize('it was the best of times');
  1896.      Returns:       'It Was The Best Of Times' as the value of the func-
  1897.      tion.
  1898.  
  1899.      procedure set_cursor( setting )
  1900.  
  1901.      Accepts:  setting - byte (0/1)
  1902.  
  1903.      Function: setting = 0, cursor is turned off
  1904.                setting = 1, cursor is turned on
  1905.  
  1906.      procedure message( message, severity )
  1907.  
  1908.      Accepts:  message - string[80]
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.              DataWrite Page 29 -- Copyright (C) Tika Software, Co.
  1915. ────────────────────────────────────────────────────────────────────────────────
  1916.                setting - byte (1-4)
  1917.  
  1918.      Function: Prints message along the foot of the screen. Set severity
  1919.      to:
  1920.                1: display the message
  1921.                2: display the message and beep
  1922.                3: display the message, beep, display Any Key Continues, and
  1923.      await user input
  1924.                4: display the message, Any Key Continues, no beep
  1925.  
  1926.      Sample Call:   message('Your PC is about to explode, please leave the
  1927.      room', 3);
  1928.      procedure video( attribute )
  1929.  
  1930.      Accepts:  attribute - byte
  1931.  
  1932.      Function: no_color:      do nothing
  1933.                bright:             Normal Video
  1934.                dim:           Low Video
  1935.                reverse:       Reverse Video
  1936.  
  1937.      The four video attributes listed above are defined as global con-
  1938.      stants.
  1939.  
  1940.      Sample Call:   video( bright );
  1941.  
  1942.      procedure writexy( xpos, ypos, attribute, show_string )
  1943.  
  1944.      Accepts:  xpos, ypos - byte
  1945.                attribute - byte
  1946.                show_string - string[80]
  1947.  
  1948.      Function: displays show_string at screen(xpos, ypos) using video at-
  1949.      tribute.
  1950.  
  1951.      Sample Call:   writexy(2, 20, dim, 'Howdy Doody');
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.              DataWrite Page 30 -- Copyright (C) Tika Software, Co.
  1975. ────────────────────────────────────────────────────────────────────────────────
  1976.